<!DOCTYPE html>
<html lang="en">
<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>添加用户</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f2f2f2;
      margin: 0;
      padding: 20px;
    }
    h1 {
      text-align: center;
      color: #333;
      margin-bottom: 20px;
    }
    table {
      width: 100%;
      border-collapse: collapse;
      background-color: #fff;
      box-shadow: 0 0 10px rgba(0,0,0,0.1);
    }
    th,
    td {
      padding: 10px;
    }
    th {
      background-color: #333;
      color: #fff;
      text-align: left;
    }
    tr:nth-child(even) {
      background-color: #f2f2f2;
    }
    .btn {
      display: inline-block;
      padding: 5px 10px;
      background-color: #333;
      color: #fff;
      text-decoration: none;
      border-radius: 3px;
    }
    .btn:hover {
      background-color: #555;
    }
  </style>
<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<h1>用户列表</h1>
<form id="userForm" action="/user/addUser" th:action="@{/user/addUser}" method="post">
    <table>
        <tr>
            <td>姓名:</td>
            <td>
                <input type="text" name="name">
            </td>
        </tr>
        <tr>
            <td>年龄:</td>
            <td>
                <input type="text" name="age">
            </td>
        </tr>
        <tr>
            <td>性别:</td>
            <td>
                <input type="text" name="sex" value="0">
            </td>
        </tr>
        <tr>
            <td>状态:</td>
            <td>
                <input type="text" name="status" value="0">
            </td>
        </tr>
        <tr>
            <td>描述:</td>
            <td>
                <input type="text" name="remark">
            </td>
        </tr>
        <tr>
            <td>注册时间:</td>
            <td>
                <input type="date" name="time">
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="button" onclick="addUser()" value="添加用户" />
            </td>
        </tr>
    </table>
</form>
<script type="text/javascript">
    function addUser(){
        // 非空校验
        $("#userForm").submit();
    }
</script>
</body>
</html>